/* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements.  See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License.  You may obtain a copy of the License at
*
*     http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/


/*************************************************************************
 *\author: starlove
 *************************************************************************/
#ifndef __CC_PYTHON_IMPORT_O_TEXTUREATLAS__
#define __CC_PYTHON_IMPORT_O_TEXTUREATLAS__

#include <cocos2d.h>
#include "python_object_nodeobjects.h"

NS_CCPY_BEGIN
	CC_OBJECT_WRAPPER_DEF_BEGIN(CCTextureAtlas)
    GLushort*           get_m_pIndices();
    void				set_m_pIndices(GLushort* v);
#if CC_TEXTURE_ATLAS_USE_VAO
    GLuint				get_m_uVAOname();
    void				set_m_uVAOname(GLuint v);
#endif
    GLuint              get_m_pBuffersVBO(int index);
    void				set_m_pBuffersVBO(int index, GLuint v);
    bool                get_m_bDirty();
	void				set_m_bDirty(bool b);


    unsigned int		_TotalQuads();
	unsigned int		_Capacity();
    cocos2d::CCTexture2D *		_Texture();
    cocos2d::ccV3F_C4B_T2F_Quad * _Quads();
	CC_OBJECT_WRAPPER_DEF_END

	class CPyTextureAtlas : public CPyCCObject
	{
	PYCLASS_DEF_INTERFACE(CPyTextureAtlas)
	public:
	CPyTextureAtlas();

    PYCLASS_METHOD_DEF(CPyTextureAtlas, initWithFile);
    PYCLASS_METHOD_DEF(CPyTextureAtlas, initWithTexture);
    PYCLASS_METHOD_DEF(CPyTextureAtlas, updateQuad);
    PYCLASS_METHOD_DEF(CPyTextureAtlas, insertQuad);
    PYCLASS_METHOD_DEF(CPyTextureAtlas, insertQuads);
    PYCLASS_METHOD_DEF(CPyTextureAtlas, insertQuadFromIndex);
    PYCLASS_METHOD_DEF(CPyTextureAtlas, removeQuadAtIndex);
    PYCLASS_METHOD_DEF(CPyTextureAtlas, removeQuadsAtIndex);
    PYCLASS_METHOD_DEF(CPyTextureAtlas, removeAllQuads);
    PYCLASS_METHOD_DEF(CPyTextureAtlas, resizeCapacity);
    PYCLASS_METHOD_DEF(CPyTextureAtlas, increaseTotalQuadsWith);
    PYCLASS_METHOD_KW_DEF(CPyTextureAtlas, moveQuadsFromIndex);
    PYCLASS_METHOD_DEF(CPyTextureAtlas, fillWithEmptyQuadsFromIndex);
    PYCLASS_METHOD_KW_DEF(CPyTextureAtlas, drawNumberOfQuads);
    PYCLASS_METHOD_DEF(CPyTextureAtlas, drawQuads);
    PYCLASS_METHOD_DEF(CPyTextureAtlas, listenBackToForeground);
	
    PYCLASS_GETSET_MAPPING_DEF(CPyTextureAtlas, _pIndices);
#if CC_TEXTURE_ATLAS_USE_VAO
    PYCLASS_GETSET_MAPPING_DEF(CPyTextureAtlas, _uVAOname);
#endif
    PYCLASS_GETSET_MAPPING_DEF(CPyTextureAtlas, _pBuffersVBO_1);
    PYCLASS_GETSET_MAPPING_DEF(CPyTextureAtlas, _pBuffersVBO_2);
    PYCLASS_GETSET_MAPPING_DEF(CPyTextureAtlas, _bDirty);
    PYCLASS_GET_DEF(CPyTextureAtlas, _TotalQuads);
    PYCLASS_GET_DEF(CPyTextureAtlas, _Capacity);
    PYCLASS_GET_DEF(CPyTextureAtlas, _Texture);
    PYCLASS_GET_DEF(CPyTextureAtlas, _Quads);

	void setRaw(){ setCCObject(&m_raw); }
	private:
		cocos2d::CCTextureAtlas m_raw;
	};

NS_CCPY_END

#endif